package com.fenshi.manager.activity;

import android.app.Activity;

import com.quickdv.activity.BaseApplication;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lilongfei on 15/7/13.
 */
public class MApplication extends BaseApplication {

    List<Activity> task ;

    @Override
    public void onCreate() {
        super.onCreate();
        task = new ArrayList<>();
    }

    public void addTask(Activity act){
        task.add(act);
    }

    public void removeTask(int positions){
        task.remove(positions);
    }

    public void removeTask(Activity act){
        task.remove(act);
    }

    public void clearTask(){
        task.clear();
    }

    public void finishTask(){
        for (Activity act:task){
            act.finish();
        }
        clearTask();
    }

}
